*This file just replicates the figures. Look at the Dissents folder for the R code on matching

*Sets working directory
**CHANGE THIS TO YOUR OWN DIRECTORY
cd "C:\Users\ev42\Dropbox\Gender and Judging\Replication\"

  *Figure 1: Trends in female judges
use "Femalejudges.dta", clear
drop if year<1990
drop if njudges<3

gen manel=0
replace manel=1 if meanfemale==0

*Create collapsed data
collapse (mean) female-nationalfemale manel, by(year )


twoway (line female year) (line manel year) if year<2016, ///
scheme(plotplain)  legend(order(1 "Female Judges" 2 "Manel")) ///
title("Average Proportion Female Judges") note("Decisions and Judgments by Committees and Chambers") ytitle("Proportion of Panels") ///
 xtitle("Year")


 *Figure 2: Trends in Gender of Applicants


use "ApplicationNumberDataset.dta", clear

keep if singleapplicant==1

egen avfemale=mean(femaleapplicant), by(appyear)

twoway (scatter avfemale appyear) (lowess femaleapplicant appyear) if singleapplicant==1 & appyear<2016 & appyear>1994, ylabel(0(.05).3) ///
 xtitle(Application year) legend(off) ytitle("Proportion of Female Applications") scheme(plotplainblind) title("Proportion of Female Applicants (lowess)")
 
 
*Figure 3
use "ApplicationNumberDataset.dta", clear

gen physical=0
	 replace physical=1 if article2==1 | article3==1
	 gen liberty=0
	 replace liberty=1 if article4==1 | article5==1
	 gen fairtrial=0
	 replace fairtrial=1 if article6==1
	 gen discrimination=0
	 replace discrimination=1 if article14==1
	 gen privacy=0
	 replace privacy=1 if article8==1
	 gen speech=0
	 replace speech=1 if article10==1
	 gen property=0
	 replace property=1 if P1==1
	 
	 keep if Gender==1 | Gender == 3
	 
	  graph hbar (mean) physical liberty fairtrial discrimination privacy speech property, over(Gender) showyvars ///
 yvaroptions(relabel(1 "Physical Integrity Rights" 2 "Liberty" 3 "Fair Trial" 4 "Discrimination" 5 "Privacy" 6 "Speech" 7 "Property")) ///
 legend(off) scheme(plotplain) ytitle("Proportion of Applications") 
 

